package com.example.lirisheng.springbootfinalexperiment.util;

import lombok.Data;

import javax.persistence.criteria.CriteriaBuilder;

@Data
public class RespBean {

    Integer status;
    String  message;
    Object data;


    public RespBean(Integer status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public static RespBean ok(String messsage){
        return new RespBean(500,messsage,null);
    }

    public static RespBean ok(String messsage,Object data){
        return new RespBean(500,messsage,data);
    }

    public static RespBean error(String messsage){
        return new RespBean(400,messsage,null);
    }

    public static RespBean error(String messsage,Object data){
        return new RespBean(400,messsage,data);
    }
}
